package com.ethink.warehouse.api.enums;

import com.ethink.framework.common.constant.ColumnEnum;


/**
 * 物流跟进单 枚举 始发主体类型:1-供应商(t1)|2-客户(t2)|3-分仓(t3)
 *
 * @author default
 * @date 2022-11-15
 */
public enum LogisticsTraceOrderSourceEntityTypeEnum implements ColumnEnum {

    /** 供应商 */
    T1(1, "供应商"),

    /** 客户 */
    T2(2, "客户"),

    /** 分仓 */
    T3(3, "分仓"),

    ;

    /**
     * 枚举int值
     */
    private Integer intValue;

    /**
     * 枚举名称
     */
    private String name;

    /**
     * 构造方法
     *
     * @param intValue
     * @param name
     */
    LogisticsTraceOrderSourceEntityTypeEnum(Integer intValue, String name) {
        this.intValue = intValue;
        this.name = name;
    }

    /**
     * 枚举int值
     *
     * @return
     */
    @Override
    public Integer getIntValue() {
        return intValue;
    }

    /**
     * 枚举名称
     *
     * @return
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * 枚举int值获取枚举
     * @param intValue
     * @return
     */
    public static LogisticsTraceOrderSourceEntityTypeEnum valueOf(Integer intValue) {
        for (LogisticsTraceOrderSourceEntityTypeEnum value : LogisticsTraceOrderSourceEntityTypeEnum.values()) {
            if(value.getIntValue().equals(intValue)) {
                return value;
            }
        }
        return null;
    }
}
